#define _CRT_SECURE_NO_WARNINGS 1
#include<stdio.h>
int main()
{
	int arr1[100];
	int arr2[100];
	int i = 0;
	int k = 0;
	int j = 0;
	int n = 0;
	scanf("%d", &n);
	for (i = 0; i < n; i++)
	{
		scanf("%d", &arr1[i]);
	}
	scanf("%d", &k);
	for (i = 0,j=0; i < n; i++)
	{
		if (k!=arr1[i])
		{
			arr2[j] = arr1[i];
			j++;
		}
	}
	for (i = 0; i < j; i++)
	{
		printf("%d ", arr2[i]);
	}

	return 0;
}